if (state == MOVEMENT_WALK_RIGHT || state == MOVEMENT_JUMP_RIGHT) {
    if (place_free(x, y+1))
        state   = MOVEMENT_JUMP_RIGHT;
    else
        state   = MOVEMENT_STAND_RIGHT;
}
else if (state == MOVEMENT_WALK_LEFT || state == MOVEMENT_JUMP_LEFT) {
    if (place_free(x, y+1))
        state   = MOVEMENT_JUMP_LEFT;
    else
        state   = MOVEMENT_STAND_LEFT;
}
